<?php

/**
 * Description of TimeplHelper
 *
 * @author jarrod
 */
App::import('Helper', 'Time');

class TimeplHelper extends TimeHelper {

    function niceShort($dateString = null, $userOffset = null) {
        $date = $dateString ? $this->fromString($dateString, $userOffset) : time();
        
        if ($this->isToday($dateString, $userOffset)) {
            $ret = sprintf(__('Today, %s'), strftime("%H:%M", $date));
        } elseif ($this->wasYesterday($dateString, $userOffset)) {
            $ret = sprintf(__('Yesterday, %s'), strftime("%H:%M", $date));
        } elseif ($this->isTomorrow($dateString, $userOffset)) {
            $ret = sprintf(__('Tommorow, %s'), strftime("%H:%M", $date));
        } else {
            $y = $this->isThisYear($date) ? '' : ' %Y';
            $format = $this->convertSpecifiers("%b %e{$y}, %H:%M", $date);
            $ret = strftime($format, $date);
        }
        return $ret;
    }
}

?>
